﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="EditPopedomGroup.aspx.cs" Inherits="admin_EditPopedomGroup" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>无标题页</title>
    
    <link rel="Stylesheet" type="text/css" href="../Styles/right_style.css" />
    <script type="text/javascript" src="../Scripts/jquery.ui/js/jquery.js"></script>

    <style type="text/css">
        <!--
        html{ scrollbar-base-color: #dbecf8; scrollbar-arrow-color: #2a8ed1; scrollbar-track-color: #bdddf2; scrollbar-3dlight-color: #2886c5; scrollbar-darkshadow-color: #2886c5;
        scrollbar-face-color: #dbecf8; scrollbar-shadow-color: #dbecf8;  }
        -->
    </style>

</head>
<body bgcolor="#eeeeee">
    <form id="form1" runat="server">
            <div class="sub_right_top">
  <div class="hdm_header" >
    <div class="tb1_on"><h2 class="h2_icon">角色权限管理</h2></div>

    <div class="clear"></div>
  </div>
  <div class="hdm_footer">
   <div class="fabu_gg_title" style="margin-left:29px;">编辑权限</div>          
    <form id="form2" name="form1" method="post" action="">     
      <table width="480" border="0" align="center" cellpadding="0" cellspacing="0" >
            <tr>
              <td width="230" align="center">所有权限</td>
              <td width="20">&nbsp;</td>

              <td width="230" align="center">现有权限</td>
            </tr>
            <tr>
              <td width="230" align="center">
                <asp:ListBox ID="ListBox1" runat="server" Height="250px" SelectionMode="Multiple"
                        Width="150px"></asp:ListBox>
                         </td>
              <td width="20"><p>
                <asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="~/images/to_1l.gif"
                        OnClientClick="addOption();return false;" OnClick="ImageButton2_Click" />
              </p>

                <p>&nbsp;</p>
                <p>
                        <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/images/to_1r.gif"
                        OnClientClick="delOption();return false;" OnClick="ImageButton1_Click" />
                </p></td>
              <td width="230" align="center">
                    <asp:ListBox ID="ListBox2" runat="server" Height="250px" SelectionMode="Multiple"
                        Width="150px"></asp:ListBox>
              </td>
            </tr>
            <tr>
              <td width="230" align="center">
                <asp:Button ID="Button1" runat="server" OnClientClick="selectAll('ListBox1');return false;"
                        Text="" CssClass="com_all_button"/>
                </td>

              <td width="20">&nbsp;</td>
              <td width="230" align="center">
                <asp:Button ID="Button5" runat="server" OnClientClick="selectAll('ListBox2');return false;"
                        Text=""  CssClass="com_all_button"/>
                  </td>
            </tr>
            <tr>
              <td colspan="3" align="center">
                <asp:Button ID="Button2" runat="server" OnClick="Button1_Click" OnClientClick="selectAll('lbSellManager');selectAll('lbSellUser');"
                        Text="" CssClass="queding_anniu"/>
                <asp:Button ID="Button3" runat="server"  PostBackUrl="~/admin/PopedomGroupList.aspx"
                        Text="" CssClass="fanhui_anniu"/>
              </td>

        </tr>
      </table>
    <div style="height:20px;"></div>
    </form>
  </div>
</div>

    </form>
</body>
</html>
<script language="javascript" type="text/javascript">
var item=document.getElementById('lbSellUser');
var setitem=document.getElementById('lbSellManager');
function addOption()
{
    var arrayValue=new Array();
    for(var i=0;i<item.length;i++)
    {
        if(item.options[i].selected)
        {
            var opt=new Option(item.options[i].text,item.options[i].value);
            setitem.options[setitem.length]=opt;
            arrayValue.push(item.options[i].value);
        }
    }
    for(var i=0;i<arrayValue.length;i++)
    {
        for(var j=0;j<item.length;j++)
        {
            if(item.options[j].value==arrayValue[i])
            {
                item.options[j]=null;
            }
        }
    }
}
function delOption()
{
    var arrayValue=new Array();
    for(var i=0;i<setitem.length;i++)
    {
        if(setitem.options[i].selected)
        {
            var opt=new Option(setitem.options[i].text,setitem.options[i].value);
            item.options[item.length]=opt;
            arrayValue.push(setitem.options[i].value);
        }
    }
    for(var i=0;i<arrayValue.length;i++)
    {
        for(var j=0;j<setitem.length;j++)
        {
            if(setitem.options[j].value==arrayValue[i])
            {
                setitem.options[j]=null;
            }
        }
    }
}
function selectAll(items)
{
    var itemss= document.getElementById(items);
    for(var i=0;i<itemss.options.length;i++)
    {
        itemss.options[i].selected=true;
    }
}
</script>